home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / misc / gms_dev.lha / GMSDev / Source / Asm / Chunky / ChunkyPicture.s < prev    next >
Encoding:
Text File  |  1998-07-07  |  2.5 KB  |  108 lines

  1. ;-------T-------T------------------------T----------------------------------;
  2. ;This demo loads in a picture in chunky format and then calls RefreshScreen()
  3. ;to do the C2P conversion.
  4.  
  5.     INCDIR    "INCLUDES:"
  6.     INCLUDE    "dpkernel/dpkernel.i"
  7.  
  8. ;===========================================================================;
  9. ;                             INITIALISE DEMO
  10. ;===========================================================================;
  11.  
  12.     SECTION    "Demo",CODE
  13.  
  14.     STARTDPK
  15.  
  16. Start:    MOVEM.L    A0-A6/D1-D7,-(SP)
  17.     move.l    DPKBase(pc),a6
  18.     lea    ScreenTags(pc),a0
  19.     sub.l    a1,a1
  20.     CALL    Init
  21.     tst.l    d0
  22.     beq.s    .Exit
  23.  
  24.     ;Load the picture.
  25.  
  26.     move.l    Screen(pc),a1
  27.     move.l    GS_MemPtr1(a1),PicData
  28.     lea    PictureTags(pc),a0
  29.     sub.l    a1,a1
  30.     CALL    Init
  31.     tst.l    d0
  32.     beq.s    .Exit
  33.  
  34.     ;Update palette to that of the picture.
  35.  
  36.     move.l    SCRBase(pc),a6
  37.     move.l    Screen(pc),a0
  38.     move.l    Picture(pc),a1
  39.     move.l    GS_Bitmap(a0),a2
  40.     move.l    PIC_Bitmap(a1),a3
  41.     move.l    BMP_Palette(a3),BMP_Palette(a2)
  42.     CALL    scrUpdatePalette
  43.  
  44.     move.l    DPKBase(pc),a6
  45.     move.l    Screen(pc),a0
  46.     CALL    Display
  47.  
  48.     bsr.s    Main
  49.  
  50. .Exit    move.l    DPKBase(pc),a6
  51.     move.l    Picture(pc),a0
  52.     CALL    Free
  53.     move.l    Screen(pc),a0
  54.     CALL    Free
  55.     MOVEM.L    (SP)+,A0-A6/D1-D7
  56.     moveq    #ERR_OK,d0
  57.     rts
  58.  
  59. ;===========================================================================;
  60. ;                                MAIN LOOP
  61. ;===========================================================================;
  62.  
  63. Main:    move.l    SCRBase(pc),a6
  64.     move.l    Screen(pc),a0
  65.     CALL    scrRefreshScreen
  66.  
  67.     move.l    DPKBase(pc),a6
  68.     move.l    #200,d0
  69.     CALL    WaitTime
  70.     rts
  71.  
  72. ;===========================================================================;
  73. ;                                  DATA
  74. ;===========================================================================;
  75.  
  76. ScreenTags:    dc.l  TAGS_SCREEN
  77. Screen:        dc.l  0
  78.         dc.l  GSA_Width,320
  79.         dc.l  GSA_Height,256
  80.         dc.l    GSA_BitmapTags,0
  81.         dc.l    BMA_Type,CHUNKY8
  82.         dc.l    TAGEND,0
  83.         dc.l  TAGEND
  84.  
  85. PictureTags:    dc.l  TAGS_PICTURE
  86. Picture:    dc.l  0
  87.         dc.l    PCA_BitmapTags,0
  88.         dc.l    BMA_Data
  89. PicData:    dc.l    0
  90.         dc.l    BMA_Width,320
  91.         dc.l    BMA_Height,256
  92.         dc.l    BMA_Type,CHUNKY8
  93.         dc.l    TAGEND,0
  94.         dc.l  PCA_Source,.file
  95.         dc.l  TAGEND
  96.  
  97. .file        FILENAME "GMS:demos/data/PIC.Green"
  98.  
  99. ;===========================================================================;
  100.  
  101. ProgName:    dc.b  "Chunky Picture",0
  102. ProgAuthor:    dc.b  "Paul Manias",0
  103. ProgDate:    dc.b  "July 1998",0
  104. ProgCopyright:    dc.b  "DreamWorld Productions (c) 1996-1998.  Freely distributable.",0
  105. ProgShort:    dc.b  "Chunky demonstration.",0
  106.         even
  107.  
  108.